(() => {
    function getArr(value, count) {
        const arr = [];
        for (let i = 0; i < count; i++) {
            arr.push(value);
        }
        return arr;
    }
    let arr1 = getArr(4, 5);
    console.log(arr1);
    function getArr2(value, count) {
        const arr = [];
        for (let i = 0; i < count; i++) {
            arr.push(value);
        }
        return arr;
    }
    let arr2 = getArr2('abc', 5);
    console.log(arr2);
    // 泛型函数
    function getArr3(value, count) {
        const arr = [];
        for (let i = 0; i < count; i++) {
            arr.push(value);
        }
        return arr;
    }
    let arr3 = getArr3('abc', 5);
    console.log(arr3);
    let arr4 = getArr3(5, 5);
    console.log(arr4);
})();
